<template>
  <el-container>
    <el-row>
      <el-col :span="3" v-for="sj in sjdata" :key="sj.id">
        <el-card :body-style="{ padding: '10px' }">
          <img :src="sj.cover" class="image">
          <div style="padding: 14px;">
            <span>{{sj.name}}</span>
            <div class="bottom clearfix">
              <time class="time">{{ currentDate }}</time>
              <el-button type="text" class="button">操作按钮</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </el-container>
</template>

<script>
  export default {
    data() {
      return {
        currentDate: new Date(),
        sjdata: []
      }
    },
    created() {
      this.getData();
    },
    methods: {
      async getData() {
        let sel = this
        let a = this.$axios.get('/api/phone')
          .then(function(res) {
            sel.sjdata = res.data
          })
      }
    }

  }
</script>

<style>
  .el-container {
    margin: 10px;
  }

  .el-card {
    margin: 2px;
  }

  .time {
    font-size: 13px;
    color: #999;
  }

  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }
</style>
